// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 新建mqtt用户 POST /mqtt/user/add */
export async function mqttUserControllerSave(
  body: API.MqttUserDTO,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/mqtt/user/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除mqtt用户 DELETE /mqtt/user/del */
export async function mqttUserControllerDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.mqttUserControllerDeleteParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/mqtt/user/del`, {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 修改mqtt用户信息 PUT /mqtt/user/edit */
export async function mqttUserControllerEdit(
  body: API.MqttUserDTO,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/mqtt/user/edit`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
